﻿@model NewsImage
@{
    if (ViewBag.IsEdit != null && ViewBag.IsEdit == true)
    {
        ViewBag.Title = "Sửa Hình ảnh mục tin tức";
    }else
    {
        ViewBag.Title = "Thêm mới Hình ảnh mục tin tức";
    }
        
}

<div class="main-content-inner">
    <div class="breadcrumbs" id="breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <i class="ace-icon fa fa-home home-icon"></i>
                <a href="@Url.Action("index", "home")">Home</a>
            </li>
            <li><a href="@Url.Action("SearchNews", "News")">Danh sách tin tức</a></li>
            <li><a href="@Url.Action("SearchNewsImage", "News",new { NewsId = Model.NewsId })">Danh sách Hình ảnh</a></li>
            @if (ViewBag.IsEdit != null && ViewBag.IsEdit == true)
            {
                <li class="active">Sửa Hình ảnh @Model.NewsImageTitle</li>
            }
            else
            {
                <li class="active">Tạo mới Hình ảnh mục tin tức </li>
            }
        </ul>
        <!-- /.breadcrumb -->

        
    </div>

    <div class="page-content">


        <div class="page-header">
            @if (ViewBag.IsEdit != null && ViewBag.IsEdit == true)
            {
            <h1>Sửa Hình ảnh @Model.NewsImageTitle

            </h1>
            }
            else
            {
                <h1>Tạo mới Hình ảnh mục tin tức

            </h1>
            }
        </div>
        <!-- /.page-header -->
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="row">
                    <div class="col-xs-12">
                        @using (Html.BeginForm(null, null, FormMethod.Post, new { @id = "manageForm", @class = "form-horizontal" }))
                        {
                            @Html.AntiForgeryToken()
                            if (ViewBag.IsEdit != null && ViewBag.IsEdit == true)
                            {
                            @Html.HiddenFor(mbox => mbox.NewsImageId)
                            }
                            @Html.HiddenFor(mbox => mbox.NewsId)
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="NewsImageTitle">Tiêu đề:</label>

                                <div class="col-xs-12 col-sm-10">
                                    <div class="clearfix">
                                        <input type="text" name="NewsImageTitle" id="NewsImageTitle" class="col-xs-12 col-sm-6" value="@Model.NewsImageTitle" required/>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="NewsImageUrl">Hình Ảnh:</label>

                                <div class="col-xs-12 col-sm-6">
                                    <div class="clearfix">
                                        @Html.TextBoxFor(model => model.NewsImageUrl)
                                        @Html.Partial("FileManagerButton", "NewsImageUrl")
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="OrderNo">Thứ tự:</label>

                                <div class="col-xs-12 col-sm-10">
                                    <div class="clearfix">
                                        <input type="number" name="OrderNo" id="OrderNo" class="col-xs-12 col-sm-1" value="@Model.OrderNo" />
                                    </div>
                                </div>
                            </div>
                           
                             <div class="form-group">
                                 @{var check = Model.IsActive ? "checked" : "";}
                                <label class="control-label col-xs-12 col-sm-2 no-padding-right" for="IsActive">Trạng thái:</label>

                               <div class="checkbox">
													<label>
														<input name="IsActive" type="checkbox" class="ace" value="true" @check>
                                                        
														<span class="lbl"> Ẩn/Hiện hình ảnh</span>
                                                        <input name="IsActive" type="hidden" value="false" />
													</label>
												</div>
                            </div>
                            <input type="submit" id="submitContact" class="btn btn-success" value="Lưu" />
                        }
                    </div>
                </div>
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->
    </div>
    <!-- /.page-content -->
</div>
<script type="text/javascript">
    $('textarea[class*=autosize]').autosize({ append: "\n" });
    $('textarea.limited').inputlimiter({
        remText: '%n character%s remaining...',
        limitText: 'max allowed : %n.'
    });
</script>

<script type="text/javascript">
    setAdminCurrentUrl('@Url.Action("SearchNews", "News")');
</script>

@section Scripts {
	<script src="~/scripts/tinymce/tiny_mce.js"></script>

}